package cn.coastalinfo.project.drools.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * @Auther hadge
 * @Date 2024/6/5
 */
public enum LeftAssignEnums {
    Variable("Variable","参数"),
    Input("Input","输入");
//    DATE("Date","日期");

    @EnumValue
    private final String code;
    @JsonValue
    private final String name;

    LeftAssignEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    public static LeftAssignEnums of(String code) {
        for (LeftAssignEnums VariableType : LeftAssignEnums.values()) {
            if (VariableType.getCode().equals(code)) {
                return VariableType;
            }
        }
        return null;
    }

    public static String getDescriptionName(String code) {
        for (LeftAssignEnums dr : LeftAssignEnums.values()) {
            if (code.equals(dr.getCode())) {
                return dr.getName();
            }
        }
        return "";
    }
}
